automatic JSX runtime
react 17から入った
https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html
https://zenn.dev/uhyo/articles/react17-new-jsx-transform
jsx記法はReact.createElementになったり、オプションで指定した関数に置き換えられるのだが、そこらへんの挙動が変わった
reactの場合は、React.createElmentで、import reactが必要なのだが、それが必要なくなった
react/jsx-runtimeというのを使うらしい
babelやtypescriptでここらへんは設定する
tsはTypeScript 4.1
https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#jsx-factories
compilerOptionのjsxで
react-jsx
react-jsxdev
ファイル内にimport react書かなくて済む以外にもパフォーマンス上のメリットがあったはずだが忘れた
利用者としてはただ使うだけだからまた今度ということでmiyamonz.icon